﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL_Class;

namespace NLLSite.UserControl
{
    public partial class Partner : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            UIAdvertise objUIAdvertise = new UIAdvertise();
            IEnumerable<DAL_Class.Partner> objAd = objUIAdvertise.GetBannerPartner();
            if (objAd.Count() > 6) {
                lblPartner.Text += "<marquee style=\"padding:0px 20px 0px 20px;\">";
            }
            foreach (DAL_Class.Partner ad in objAd)
            {
                lblPartner.Text += "<div style=\"width:170px; display:inline;background:#FFF;padding:0px 5px 0 5px;\"><a href =\"" + ad.Link + "\"><img border=\"0\" styles=\"\" src=\"" + ad.ImageUrl + "\"/></a></div>";
            }
            if (objAd.Count() > 5)
            {
                lblPartner.Text += "</marquee>";
            }
        }
    }
}